luci-base: ui.js: rework dropdown focus behavior
authorJo-Philipp Wich <[email protected]>
Sun, 18 Feb 2024 22:25:55 +0000 (23:25 +0100)
committerPaul Donald <[email protected]>
Thu, 7 Mar 2024 00:38:35 +0000 (01:38 +0100)
commitd2f57f779bc1b08fc44f39205195abfc828086d5
tree45497fc43ff3b73e0e3bf3ebbc9d37806696d621
parentdcb2c74e6cde6a2eb8682491cca4b6151740a7cc
luci-base: ui.js: rework dropdown focus behavior

Drop mouse following focus behavior as it interferes with custom value inputs,
rely on CSS based hover effects instead.

Also slightly improve keyboard navigation by auto-focussing the custom value
input when entering the last dropdown choice via arrow down or tab key, and
by allowing to leave the text input again with the arrow up key.

Fixes: #6903
Signed-off-by: Jo-Philipp Wich <[email protected]>
(cherry picked from commit 3980c192cda6985c2e2d2608e74677cf236005db)
modules/luci-base/htdocs/luci-static/resources/ui.js